package io.github.junxworks.qt.modules.data.utils;

import java.time.DayOfWeek;
import java.time.LocalDateTime;

/**
 * @program :springbootdev
 * @description:
 * @author:Junxworks
 * @create:2019-08-21 16:45
 */
public class CommUtils
{
    public static boolean checkIsNeedRun()
    {

        LocalDateTime localDateTime = LocalDateTime.now();
        DayOfWeek dayOfWeek = localDateTime.getDayOfWeek() ;

        if(dayOfWeek== DayOfWeek.SATURDAY || dayOfWeek== DayOfWeek.SUNDAY)
        {
            return false ;
        }

        int hour = localDateTime.getHour()  ;
        int min = localDateTime.getMinute() ;
        if(hour>=16 || hour<9 || hour==12)
        {
            return false ;
        }
        if(hour==15 && min>15)
        {
            return false ;
        }
        if(hour==11 && min>30)
        {
            return false ;
        }
        if(hour==9 && min<30)
        {
            return false;
        }
        return true ;
    }
}
